<?php
defined('SYS_RUN') or exit();

abstract class Response {

    const STATUS_SUCCESS          = 10;

    const STATUS_INCORRECT_FORMAT = 20;

    const STATUS_FAILED           = 30;

    protected $_status = self::STATUS_SUCCESS;

    protected $_message = '';

    protected $_messages = array();

    protected $_data = null;

    abstract function send();

    abstract function getResponse();

    public function setStatus($status) {
        $this->_status = $status;
        return $this;
    }

    public function setMessage($message) {
        $this->_message = $message;
        return $this;
    }

    public function setAnswer($status, $message) {
        $this->setStatus($status);
        $this->setMessage($message);
        return $this;
    }

    public function setData($array) {
        $this->_data = $array;
        return $this;
    }
}